<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <title>管理中心-商品订单</title>
    <link rel="stylesheet" href="/src/font/iconfont.css">
    <link rel="stylesheet" href="/src/libs/bootstrap-3.3.5-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/manage.css">
    <script id="script" src="/src/libs/require.min.js" defer async="true" require-module="./manage_goods_order"
            data-main="/src/js/config.js"></script>
	<script type="text/javascript" src="/src/font/jedate.js">
	</script>
	
    <!--[if lt IE 9]>
    <script src="/lib/html5shiv.min.js"></script>
    <script src="/lib/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        .td{border:solid #add9c0; border-width:0px 1px 1px 0px; padding:10px 0px;}
        .table{border:solid #add9c0; border-width:1px 0px 0px 1px;}
        .datainp{ width:60px; height:30px; border:1px #ccc solid;}
        .datep{ margin-bottom:1px;}
        body{
            line-height: 25px;
        }
    </style>
</head>

<body>
<!--include "../public/manage_sidebar.html"-->
<!--include "../public/manage_header.html"-->
<div class="container-wrap">
    <div class="bread-nav clearfix p-l-lg">
        <ol class="fl">
            <li class="fl active text-333 text-basic"><a href="javascript:void(0);">商品订单</a></li>
        </ol>
        <div class="fr" id="exportdata">
            <a href="javascript:void(0);" class="btn btn-primary m-r-lg text-basic">+导出订单</a>
        </div>
    </div>
    <div class="row">
        <div class="m-r-lg m-l-lg">
            <div class="table-responsive">
                <table class="table table-hover m-t " width="100%" style="min-width:100%;">
                    <thead>
                    <tr>
                        <th class="font-normal text-basic td" width="3%">编号</th>
                        <th class="font-normal text-basic td" width="7%">选择</th>
                        <th class="font-normal text-basic td" width="10%">订单号</th>
                        <th class="font-normal text-basic td" width="20%">下单时间</th>
                        <th class="font-normal text-basic td" width="7%">订单金额</th>
                        <th class="font-normal text-basic td" width="5%">会员手机</th>
                        <th class="font-normal text-basic td" width="8%">是否开发票</th>
                        <th class="font-normal text-basic td" width="5%">付款方式</th>
                        <th class="font-normal text-basic td" width="5%">支付状况</th>
                        <th class="font-normal text-basic td" width="5%">配送状态</th>
                        <th class="font-normal text-basic td" width="20%">操作</th>
                    </tr>
                    <tr>
                        <form class="form-horizontal p-t-lg" id="form-box">
                            <th class="font-normal text-basic td" ></th>
                            <th class="font-normal text-basic td" ><input type="checkbox" value="" id="checkAll"/>全选</th>
                            <th class="font-normal text-basic td" >
                                <input type="text" id="orderNumber" name="orderNumber" class="form-control" value="">
                            </th>
                            <th class="font-normal text-basic td" >
                                <div>
                                    <input type="text" id="createTime_ge" name="createTime_ge" class="datainp" value="" placeholder="开始日期" readonly>--
                                    <input type="text" id="createTime_le" name="createTime_le" class="datainp" value="" placeholder="结束日期"  readonly>
                                </div>
                            </th>
                            <th class="font-normal text-basic td" >
                                ----
                            </th>
                            <th class="font-normal text-basic td" >
                                <input type="text" id="phone" name="phone" class="form-control" value="" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')">
                            </th>
                            <th class="font-normal text-basic td" >
                                <select  id="invoiceTag" >
                                    <option  value="">全部</option>
                                    <option  value="1">是</option>
                                    <option  value="0">否</option>
                                </select>
                            </th>
                            <th class="font-normal text-basic td" >
                                <select  id="paymentId" >
                                    <option  value="">全部</option>
                                    <option  value="3">累计付款</option>
                                    <option  value="2">在线支付</option>
                                    <option  value="1">货到付款</option>
                                </select>
                            </th>
                            <th class="font-normal text-basic td" >
                                <select  id="payState" >
                                    <option  value="">全部</option>
                                    <option  value="2">已支付</option>
                                    <option  value="1">未支付</option>
                                </select>
                            </th>
                            <th class="font-normal text-basic td" >
                                <select  id="logisticsState" >
                                    <option  value="">全部</option>
                                    <option  value="1">未配送</option>
                                    <option  value="2">已配送</option>
                                    <option  value="3">已确认收货</option>
                                </select>
                            </th>
                            <th class="font-normal text-basic td" >
                                <input type="button" id="submit-btn-query" value="搜索" class="btn btn-primary" >
                            </th>
                        </form>
                    </tr>
                    </thead>
                    <tbody class="text-666" id="table-list-content"></tbody>
                    <script id="table-list-tpl" type="text/html">
                        {{each dataList as value i}}
                        <tr>
                            <td class="td"><span>{{i+1}}</span></td>
                            <td class="td"><input type="checkbox" value="{{value.orderId}}" id="check_{{value.orderId}}" class="orderIdCheck"/></td>
                            <td class="td"><span class="inline-block text-ellipsis text-basic">{{value.orderNumber}}</span></td>
                            <td class="td"><span class="inline-block text-ellipsis text-basic">{{value.createTime}}</span></td>
                            <td class="td">
                                <span class="inline-block text-ellipsis text-basic">{{value.paidAmount/100}}</span>
                            </td>
                            <td class="td"><span class="inline-block text-ellipsis text-basic">{{value.user.phone}}</span></td>
                            <td class="td">
                                <span class="inline-block text-ellipsis text-basic">{{if value.invoiceTag==0}}否 {{else if value.invoiceTag==1}}是{{/if}}</span>
                            </td>
                            <td class="td">
                                <span class="inline-block text-ellipsis text-basic">{{value.payment.name}}</span>
                            </td>
                            <td class="td">
                                <span class="inline-block text-ellipsis text-basic">{{if value.payState==1}}未支付 {{else if value.payState==2}}已支付{{/if}}</span>
                            </td>
                            <td class="td">
                                <span class="inline-block text-ellipsis text-basic">{{if value.logisticsState==0}}未配送 {{else if value.logisticsState==1}}等待配送{{else if value.logisticsState==2}}已配送{{else if value.logisticsState==3}}已确认收货{{/if}}</span>
                            </td>
                            <td class="td">
                                <a href="/page/manage_order_detail.html?id={{value.orderNumber}}&orderId={{value.orderId}}&lid=1">订单详情</a>
                                {{if value.logisticsState==1&&(value.payment.paymentId==1||value.payment.paymentId==3)}}
                                <!--<a href="javascript:void(0);" class="send-modal" oNum="{{value.orderNumber}}">配送</a>-->
                                <a href="javascript:void(0);" class="send-modal" oid="{{value.orderId}}"
                                   oNum="{{value.orderNumber}}" logisticsState="{{value.logisticsState}}">配送</a>
                                {{else if value.logisticsState==1&&value.payment.paymentId==2&&value.payState==2}}
                                <a href="javascript:void(0);" class="send-modal" oid="{{value.orderId}}"
                                   oNum="{{value.orderNumber}}" logisticsState="{{value.logisticsState}}">配送</a>
                                {{/if}}
                                {{if value.logisticsState==2&&(value.payment.paymentId==1||value.payment.paymentId==3)}}
                                <!--<a href="javascript:void(0);" class="receiveGoods-modal"-->
                                <!--oid="{{value.orderId}}">确认收货</a>-->
                                <a href="javascript:void(0);" class="send-modal"
                                   oid="{{value.orderId}}" oNum="{{value.orderNumber}}"
                                   logisticsState="{{value.logisticsState}}">确认收货</a>
                                {{else if value.logisticsState==2&&value.payment.paymentId==2&&value.payState==2}}
                                <a href="javascript:void(0);" class="send-modal"
                                   oid="{{value.orderId}}" oNum="{{value.orderNumber}}"
                                   logisticsState="{{value.logisticsState}}">确认收货</a>
                                {{/if}}
                                {{if value.logisticsState==3&&value.payState==1&&(value.payment.paymentId==1||value.payment.paymentId==3)}}
                                <a href="javascript:void(0);" class="send-modal"
                                   oid="{{value.orderId}}" oNum="{{value.orderNumber}}"
                                   logisticsState="{{value.logisticsState}}">确认收款</a>
                                <!--<a href="/page/manage_order_receive_money.html?id={{value.orderNumber}}&orderId={{value.orderId}}&lid=1"-->
                                <!--class="receiveMoney-modal"-->
                                <!--oid="{{value.orderId}}">确认收款</a>-->
                                {{/if}}
                            </td>
                        </tr>
                        {{/each}}
                    </script>
                </table>
                <div id="cloading" class="hide">
                    <div id="loadmore"></div>
                </div>
            </div>
            <div class="pages fr">
                <ul id="pagination" class="pagination-container"></ul>
                <div class="page-sum text-right text-999 text-basic">当前页面总数：<span class="text-333"
                                                                                  id="page-sum">0</span></div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="send-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body">
                    <form class="form-horizontal" id="rePw" role="form">
                        <input type="hidden" name="orderId" id="orderId" />
                        <div class="row" style="margin-left: 15px;margin-right: 15px;">
                            <div id="info">
                                <h2 class="b-b text-md p-b-lg p-t-lg p-l-lg" id="title_name">配送信息</h2>

                                <div id="logisticsInfo" class="">

                                </div>
                                <script type="text/html" id="logisticsInfo-tpl">
                                    <table border="1" class="table table-bordered" style="min-width: auto;">
                                        <tr>
                                            <td>
                                                联系人姓名
                                            </td>
                                            <td>{{obj.receive.contact}}</td>
                                        </tr>
                                        <tr>
                                            <td>联系人电话</td>
                                            <td>{{obj.receive.tel}}</td>
                                        </tr>
                                        <tr>
                                            <td>送货地址</td>
                                            <td>{{obj.receive.receiveProvince }}&nbsp; {{obj.receive.receiveCity}}&nbsp;
                                                {{obj.receive.receiveCounty}}&nbsp; {{obj.receive.receiveAddress}}
                                            </td>
                                        </tr>
                                        </tr>
                                        <tr>
                                            <td>配送时间</td>
                                            <td>{{obj.sendTime}}</td>
                                        </tr>
                                    </table>
                                </script>

                                <div class="table-responsive" style="">
                                    <table class="table table-hover table-bordered m-t"  style="min-width: auto;">
                                        <thead>
                                        <tr>
                                            <th class="font-normal text-basic" width="5%">序号</th>
                                            <th class="font-normal text-basic" width="10%">商品名称</th>
                                            <th class="font-normal text-basic" width="5%">购买数量（个）</th>
                                        </tr>
                                        </thead>
                                        <tbody class="text-666" id="table-list-content2">

                                        </tbody>
                                        <script type="text/html" id="table-list-tpl2">
                                            {{if obj.orderDetailsList.length==0 }}
                                            <tr>
                                                <td><span>无</span></td>
                                                <td><span class="inline-block text-ellipsis text-basic">无</span></td>
                                                <td><span class="inline-block text-ellipsis text-basic">无</span></td>
                                            </tr>
                                            {{else}} {{each obj.orderDetailsList as value i}}
                                            <tr>
                                                <td><span>{{i+1}}</span></td>
                                                <td><span
                                                        class="inline-block text-ellipsis text-basic">{{value.goodsName}}</span>
                                                </td>
                                                <td><span
                                                        class="inline-block text-ellipsis text-basic">{{value.num}}</span>
                                                </td>
                                            </tr>
                                            {{/each}} {{/if}}
                                        </script>
                                    </table>
                                </div>
                            </div>
                            <div id="orderinfo">

                            </div>
                            <script type="text/html" id="orderinfo-tpl">
                                <div style="text-align: center;font-size: 16px;">
                                    确认已收到订单金额
                                </div>
                                <div style="text-align: center;font-size: 18px;color:#27A18C;">
                                    ¥{{obj.totalAmount/100}}
                                </div>
                                <div class="col-lg-10">
                                    <ul id="pic-document-list">

                                    </ul>
                                    <a href="javascript:void(0);" class="a-upload">
                                        <input type="file" name="" id="pic-upload" value="上传封面图">
                                        <span>上传凭证</span>
                                    </a>
                                </div>
                            </script>

                        </div>
                        <div class="modal-footer" style="text-align: center;">
                            <input type="button" value="取消" class="btn btn-primary m-r-lg" id="btn_cancel" style="background:#27A18C;">
                            <input type="submit" value="马上配送" class="btn btn-primary m-l-lg" id="sub" style="background:#27A18C;">
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!--<div class="modal fade" id="surplus-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"-->
    <!--aria-hidden="true">-->
    <!--<div class="modal-dialog">-->
    <!--<div class="modal-content">-->
    <!--<div class="modal-body">-->
    <!--<form class="form-horizontal" id="rePw2" role="form">-->
    <!--<div class="row">-->
    <!--<div id="orderinfo">-->

    <!--</div>-->
    <!--<script type="text/html" id="orderinfo-tpl">-->
    <!--<div>-->
    <!--¥{{obj.totalAmount/100}}-->
    <!--</div>-->
    <!--<div>-->
    <!--确认已收到订单金额-->
    <!--</div>-->
    <!--<div>-->
    <!--<ul id="pic-document-list">-->

    <!--</ul>-->
    <!--<a href="javascript:void(0);" class="a-upload">-->
    <!--<input type="file" name="" id="pic-upload">-->
    <!--<span>点击上传</span>-->
    <!--</a>-->
    <!--</div>-->
    <!--</script>-->
    <!--</div>-->
    <!--<div class="modal-footer">-->
    <!--<input type="button" value="取消" class="btn btn-primary m-l-lg" script="javascript();">-->
    <!--<input type="submit" value="确认" class="btn btn-primary m-l-lg">-->
    <!--</div>-->
    <!--</form>-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->
</div>
<script type="text/javascript">    
	jeDate({
		dateCell:"#createTime_ge",
		format:"YYYY-MM-DD 00:00:00",
		isTime:false, 
		minDate:"2017-04-01 00:00:00",
		maxDate:"2099-11-8 00:00:00"
	})
	jeDate({
		dateCell:"#createTime_le",
		format:"YYYY-MM-DD 23:59:59",
		isTime:false, 
		minDate:"2017-04-01 00:00:00",
		maxDate:"2099-11-8 00:00:00"
	})
	</script>

</body>
</html>
